![]() |
|||
![]()
|
![]() |
![]() Click Here! |
![]() |
IP Packet Format IP also defines a specific packet format. An IP packet consists of a header followed by arbitrary data, as illustrated in Exhibit 3-1-2.
Only the most important fields are explained here. The hlen field is a 4-bit field that indicates the header length in 4-byte words. An IP header is always a multiple of 4 bytes and is padded if necessary. The length field contains the total length in bytes of the entire IP packet, including the header. This is a 16-bit unsigned integer, so an IP packet can be at most 65,536 bytes long. The ttl field contains an integer number that is decremented each time the packet passes through a routing node. This prevents a packet from looping around an internet forever. The source and destination fields contain the source and destination addresses for the packet. The protocol field indicates the higher level protocol whose data is encapsulated within this packet. The source field indicates where the packet originated and destination field indicates the packets final destination. The data field contains any arbitrary data and is normally provided by one of the transport layer protocols. An IP packet is entirely self-contained. It can e routed on an internet without reference to any other packet. This has some implications for the transport layer protocols. In particular, IP does not guarantee delivery or the order of delivery. It is up to a transport layer protocol to perform these tasks. Fragmentation and Reassembly An IP packet can be larger than a frame of most network layer protocols. An Ethernet frames maximum size (excluding the header) is 1.500 bytes, so an IP packet larger than 1,500 bytes will not fit into a single Ethernet frame. An IP packet can be split into smaller pieces, called fragments, which can be reassembled at the final destination. Several fields in the IP header control the fragmentation and reassembly algorithm. Fragmentation can be expensive, so most IP implementations try to avoid it. However, fragmentation allows a great deal of independence from the underlying network layer protocols limitations. Routing The IP routing algorithm is extremely simple, and routing is usually performed by specialized routing nodes that do nothing else. Most IP implementations do support routing, so all that is required is to have a host node with more than a single network interface. When a node receives an IP packet, it examines the destination IP address in the IP packet header. If the address is one of the nodes own interface addresses, the node processes the packet locally. If the network or subnet number is the network number of one of the nodes own interfaces, the node knows the destination is one of the locally attached networks. In this case the node forwards the packet to the host on the local network. For a LAN, this usually means mapping the destination IP address to a data link address and framing the IP packet in a data link frame. This is done by the address resolution protocol (ARP). ARP essentially discovers the data link address of an IP configured interface by broadcasting a request for the data link address. A cache of replies is kept to eliminate ARP requests for the same address. If the destination network number is not a locally attached network, then the routing node consults a routing table to determine where to send the packet. A routing table maps an IP network number to the IP address of the next router on the path to the final destination. The next router must be on a locally attached network. The packet is forwarded to that router, which in turn repeats the algorithm and sends the packet to its next hop. The simple routing algorithm requires that consistent routing tables be maintained on all routing nodes in the internet. This can be done statically or dynamically. Static routes are manually created routing table entries. For an internetwork with a simple tree-like topology where a single path exists from any one node to another, static routing tables can be quite sufficient. Dynamic routing uses a routing update protocol to keep all routers aware of the routing topology. This is particularly important in an internetwork that periodically changes its topology, or in which more than a single path exists between nodes. Use of a dynamic protocol allows the network to respond rapidly to topological changes or routing node failures. Routing is still more art than science, in particular in a large internetwork like the Internet. Within the Internet, routing issues are very complex and the routing authority itself is distributed across the entire Internet. But for a site with a single LAN that is connected to the rest of the Internet through a single router, a simple default routing scheme will work. A default route is a route of last resort. If the destination network is not found in the routing table, the router pointed to by a default route is used instead.
|
![]() |
|
Use of this site is subject certain Terms & Conditions. Copyright (c) 1996-1999 EarthWeb, Inc.. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Please read our privacy policy for details. |